#encoding: utf-8
class Parameter < ActiveRecord::Base
  #@@types

  class << self
    def find_value(type,key)
      param = self.select("param_value").where(["param_key = :key and param_type = :type",{:type => type , :key => key}]).first
      param.nil? ? nil:param["param_value"]
    end

    def find_type(type,&block)
      #puts self.where(["param_type = :type",{:type => type}])
      p_types = self.where(["param_type = :type",{:type => type}])
      block.call(p_types)
    end

  end
end
